package edu.whut.mall.pojo.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import edu.whut.mall.common.enums.MailType;
import edu.whut.mall.common.enums.OrderType;
import edu.whut.mall.common.enums.PrintType;
import edu.whut.mall.common.enums.Sfstatus;
import lombok.*;

import java.io.Serializable;
import java.util.Date;

/**
 * Author: smq
 * Unit: D9lab
 * Date: 2021-06-07 16:15
 */
@Data
@TableName("order_trade")
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ToString
public class Order implements Serializable {
    private static final long serialVersionUID = 6;

    //自动返回id的值
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private Integer tradeId;
    private Integer productId;
    private Integer quantity;
    private Double money;
    private Integer mailno;
    //商品原始单价
    private Double originalMoney;
    //总价
    private Double totalMoney;

    private Double withdrawRatio;
    //订单状态
    private Sfstatus status;
    private PrintType printType;
    private OrderType orderType;
    private MailType mailType;
    private String mailCode;
    private String mailNumber;
    //子订单号
    private String subOrderNumber;
    private Date createTime;
    private Date updateTime;
    //确认收货时间
    private Date confirmTime;
    private Boolean isDeleted;
    //线下支付
    private Integer offlinePayments;


    public Order(Integer tradeId, Integer productId, String subOrderNumber, Integer quantity, Double money, Double originalMoney, Sfstatus status, PrintType printType, double withdrawRatio, Boolean isDeleted, Date createTime, Date updateTime, OrderType orderType, Integer offlinePayments) {
        this.tradeId = tradeId;
        this.productId = productId;
        this.subOrderNumber = subOrderNumber;
        this.originalMoney = originalMoney;
        this.quantity = quantity;
        this.money = money;
        this.status = status;
        this.printType = printType;
        this.withdrawRatio = withdrawRatio;
        this.isDeleted = isDeleted;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.orderType = orderType;
        this.offlinePayments = offlinePayments;
        this.totalMoney = quantity * money;
    }

}
